package com.againstsky.algorithm.bean;

/**
 * Created by agasinst on 2017/8/24.
 */
public class Person implements Comparable<Person> {

    private String name;

    private int age;

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int compareTo(Person o) {
       if(this.age>o.getAge()) {
           return 1;
       }
       if(this.age==o.getAge()){
           return 0;
       }
       return -1;
    }
}
